<?php

namespace App\Http\Controllers\Home;

use App\Services\Home\RegionService;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class RegionController extends Controller
{
    protected $service;

    public function __construct(RegionService $regionService)
    {
        $this->service = $regionService;
    }
    // 获取城市和地铁线
    public function getCityAndMetro(Request $request)
    {
        $city_id = $request->input('area');
        return $this->service->getCityAndMetroById($city_id);
    }
    // 获取区域
    public function getCityArea(Request $request)
    {
        return $this->service->getAreaList($request->input('area_id'));
    }
    // 获取站点
    public function getMetroStation(Request $request)
    {
        return $this->service->getMetroStation($request->input('metro_id'));
    }
}
